
<div class="title_main_cate">
<h1><a href="<?php echo category_url($cate->cat_code); ?>" class="box-title" title="Game <?php echo $cate->seo_title; ?>">Game <?php echo $cate->cat_name; ?></a></h1>
<div class="desc_cate">
	<p><?php echo $cate->cat_description; ?></p>
</div>
</div>

<?php 
	
	$cate_widget = get_widgets('mid');
	//if (isset($subcates) && $subcates) { 
	//Load wiget 
	if ($cate_widget) foreach ($cate_widget as $widget) {
		$config = array();
		$config = json_decode($widget->MPOS_CONFIG, true);
		if ($widget->MOD_NAME == 'category_module') {
			if (isset($subcates) &&empty($subcates))  // da het cat de show;
				continue;
			$current_sub_cate = array_shift($subcates);
			
			//change config to load widget;
			
			$config['cateid'] = $current_sub_cate->cat_id;
			$config['prefix'] = 'Game '.$cate->cat_name.' ';
			$config['link'] = category_url($current_sub_cate->cat_code);
			//$widget->MPOS_CONFIG = json_encode($config);
			
		}
		$config ['widget_title']  = $widget->MPOS_TITLE;
		$config ['widget_id']  = $widget->MPOS_ID;
		$config ['widget_layout']  = $widget->MPOS_LAYOUT;
			
		module_instance()->load->model($widget->MOD_CLASS);
		module_instance()->{$widget->MOD_NAME}->run($config);
	}
//}
?>

 

